//
//  ViewController.m
//  Animation
//
//  Created by 张展 on 15/12/29.
//  Copyright © 2015年 张展. All rights reserved.
//

#import "ViewController.h"
#import "ViewController1.h"
@interface ViewController ()
- (IBAction)click:(UIButton *)sender;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"sssssssssssssssss");
 // 床前明月光
//    UIView *view1 = [[UIView alloc]initWithFrame:self.view.bounds];
//    view1.backgroundColor = [UIColor colorWithRed:1.000 green:0.282 blue:0.302 alpha:1];
//    [self.view addSubview:view1];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)click:(UIButton *)sender {
    
    ViewController1 *view1 = [self.storyboard instantiateViewControllerWithIdentifier:@"viewController"];
//
    CATransition *transition = [CATransition animation];
    transition.type = kCATransitionFade;
//    transition.subtype = kCATransitionFromTop;
//    [self.view.layer addAnimation:transition forKey:nil];
    [self.navigationController.view.layer addAnimation:transition forKey:nil];
    //    [UIView transitionFromView:self.view toView:view1.view duration:1.0 options:UIViewAnimationOptionTransitionCurlUp completion:^(BOOL finished) {
//        
//    }];
//    [self.navigationController pushViewController:view1 animated:NO];
    
//    [self presentViewController:view1 animated:YES completion:NULL];
    
    
}
@end
